﻿using System;
using OneMG.Phoenix.Entity;
using OneMG.Phoenix.Respository;
using IBatisNet.DataMapper;
using OneMG.Phoenix.Kernel.IBatisUtil;

namespace OneMG.Phoenix.IBatisRepository
{
    public class OfferRepository : BaseIBatisDao,IOffer
    {
        public OfferRepository()
            : base("yihaoke_newMap.Config")
        {

        }
        public System.Int32 AddOffer(EOffer entity)
        {
			string stmtId = "OfferMap.InsertOffer";
			 Object obj = base.SqlMapper.Insert(stmtId, entity);
			 return (System.Int32)obj;
        }
        
		public  EOffer GetByOfferID (System.Int32 offerID)
        {
			string stmtId = "OfferMap.SelectByOfferID";
			return base.SqlMapper.QueryForObject<EOffer>(stmtId, offerID);
        }
        
        public  void DeleteByOfferID (System.Int32 offerID)
        {
			string stmtId = "OfferMap.DeleteByOfferID";
			base.SqlMapper.Update(stmtId, offerID);
        }
        
        public  void UpdateByOfferID (EOffer entity)
        {
			string stmtId = "OfferMap.UpdateByOfferID";
			base.SqlMapper.Update(stmtId, entity);
        }

    }
}

